﻿@page
@model OpenPms.Areas.D.Pages.Setup.Rate.EditModel
@{
    ViewData["Title"] = "编辑";
}
<nav aria-label='breadcrumb'>
    <ol class='breadcrumb'>
        
        <li class='breadcrumb-item'><a asp-page="./Index">房价码</a></li>
        <li class='breadcrumb-item active' aria-current='page'>@ViewBag.Title</li>
    </ol>
</nav>

<form method="post">
    <desk-input asp-hidden-1=Item.HotelId
                asp-for-2=Item.RateType asp-readonly-2=""
                asp-for-1=Item.Id asp-readonly-1=""
                asp-for-3=Item.Name
                asp-for-31=Item.PinYin
                asp-for-4=Item.CheckinTime
                asp-for-5=Item.CheckoutTime
                asp-for-7=Item.HourRoomLength
                asp-for-8=Item.HourRoomStepLength
                asp-for-9=Item.IsPublish
                asp-for-10=Item.IsDelete />
    <desk-buttons asp-link-text-1="保存" asp-link-type-1=EButtonType.Primary
                  asp-link-text-2="取消" asp-page-2="./Index" />
</form>
@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
    <script>
        var rn = $("#Item_Name");
        var py = $("#Item_PinYin")
        $(function () {
            rn.change(function () {
                $.get(`/api/PinYin/${rn.val()}`, function (ret) {
                    py.val(ret);
                });
            });
            if ("@((int)Model.Item.RateType)" != "2") { //非钟点房
                $("#Div7").hide();
                $("#Div8").hide();
            }
        });
    </script>
}

